<div class="uk-layui-form">
	<form class="layui-form" action="/apps/report/design/columnupdate.html">
		<input type="hidden" name="id" value="${col.id!''}">
		<input type="hidden" name="mid" value="${col.modelid!''}">
		<div class="layui-form-item">
			<label class="layui-form-label">指标名称：</label>
			<div class="layui-input-inline">
				<input type="text" maxlength="200" name="title" value="${col.title!''}" required lay-verify="required" placeholder="请输入新指标名称" autocomplete="off" class="layui-input">
			</div>
			
			<label class="layui-form-label">指标类型：</label>
			<div class="layui-input-inline">
				<select name="type" lay-filter="mea_type">
		        	<option value="default">默认</option>
		        	<option value="order" <#if col.type?? && col.type == "order">selected="selected"</#if>>序号</option>
		        	<option value="summary" <#if col.type?? && col.type == "summary">selected="selected"</#if>>汇总</option>
		        	<option value="alias" <#if col.type?? && col.type == "alias">selected="selected"</#if>>别称</option>
		        </select>
			</div>
		</div>
		
		<div class="layui-form-item mea_sum" style="<#if !(col.type?? && col.type == "summary")>display:none</#if>">
			<label class="layui-form-label">汇总层级：</label>
			<div class="layui-input-inline">
				<select name="prefix">
		        	<option value="">默认</option>
		        	<#if levels??>
		        	<#list levels as level>
		        	<option value="${level.title!''}" <#if col.prefix?? && col.prefix == level.title>selected="selected"</#if>>${level.title!''}</option>
		        	</#list>
		        	</#if>
		        </select>
			</div>
			
			<label class="layui-form-label">调整位置：</label>
			<div class="layui-input-inline">
				<input type="checkbox" name="sort" lay-skin="switch" value="1" <#if col.sort?? && col.sort>checked="checked"</#if> lay-text="启用|禁用">
			</div>
		</div>
		<div class="layui-form-item mea_sum" style="<#if !(col.type?? && col.type == "summary")>display:none</#if>">
			<label class="layui-form-label">汇总类型：</label>
			<div class="layui-input-inline">
				<select name="value" lay-filter="val_filter">
		        	<option value="">默认</option>
		        	<option value="sum" <#if col.value?? && col.value == "sum">selected="selected"</#if>>小计</option>
		        	<option value="prop" <#if col.value?? && col.value == "prop">selected="selected"</#if>>占比</option>
		        	<option value="cus" <#if col.value?? && col.value == "cus">selected="selected"</#if>>自定义</option>
		        </select>
			</div>
			
			<label class="layui-form-label val_mea" <#if !(col.value?? && col.value == "prop")>style="display:none"</#if>>占比层级：</label>
			<div class="layui-input-inline val_mea" <#if !(col.value?? && col.value == "prop")>style="display:none"</#if>>
				<select name="suffix">
		        	<option value="">默认</option>
		        	<#if levels??>
		        	<#list levels as level>
		        	<option value="${level.title!''}" <#if col.suffix?? && col.suffix == level.title>selected="selected"</#if>>${level.title!''}</option>
		        	</#list>
		        	</#if>
		        </select>
			</div>
		</div>
		<div class="layui-form-item mea_sum" style="<#if !(col.type?? && col.type == "summary")>display:none</#if>">
			<label class="layui-form-label">单元格：</label>
			<div class="layui-input-inline">
				<input type="checkbox" name="seldata" lay-skin="switch" value="1" <#if col.seldata?? && col.seldata>checked="checked"</#if> lay-text="合并|不合并">
			</div>
		</div>
		
		<div class="layui-form-item">
			<label class="layui-form-label">空值替换：</label>
			<div class="layui-input-inline">
				<input type="text" name="placeholder" autocomplete="off"
					class="layui-input" value="${col.placeholder!''}">
			</div>
			<label class="layui-form-label">格式化：</label>
			<div class="layui-input-inline">
				<select name="format">
					<option value="">默认</option>
					<option value="####" <#if col.format?? && col.format == "####">selected="selected"</#if>>####</option>
					<option value="0.0" <#if col.format?? && col.format == "0.0">selected="selected"</#if>>0.0</option>
					<option value="0.00" <#if col.format?? && col.format == "0.00">selected="selected"</#if>>0.00</option>
					<option value="0.000" <#if col.format?? && col.format == "0.000">selected="selected"</#if>>0.000</option>
					<option value="##0%" <#if col.format?? && col.format == "##0%">selected="selected"</#if>>##0%</option>
					<option value="##0.0%" <#if col.format?? && col.format == "##0.0%">selected="selected"</#if>>##0.0%</option>
					<option value="##0.00%" <#if col.format?? && col.format == "##0.00%">selected="selected"</#if>>##0.00%</option>
					<option value="###,###" <#if col.format?? && col.format == "###,###">selected="selected"</#if>>###,###</option>
					<option value="###,###.0" <#if col.format?? && col.format == "###,###.0">selected="selected"</#if>>###,###.0</option>
					<option value="###,###.00" <#if col.format?? && col.format == "###,###.00">selected="selected"</#if>>###,###.00</option>
					<option value="###,###.000" <#if col.format?? && col.format == "###,###.000">selected="selected"</#if>>###,###.000</option>
					<option value="0" <#if col.format?? && col.format == "0">selected="selected"</#if>>时:分:秒</option>
					<option value="00" <#if col.format?? && col.format == "00">selected="selected"</#if>>分:秒.00</option>
				</select>
			</div>
	  	</div>
	  	<div class="layui-form-item mea_sum">
			<label class="layui-form-label">启用分组：</label>
			<div class="layui-input-inline">
				<input type="checkbox" name="mgroup" lay-skin="switch" value="1" <#if col.mgroup?? && col.mgroup>checked="checked"</#if> lay-text="启用|禁用">
			</div>
			<label class="layui-form-label">无效数据：</label>
			<div class="layui-input-inline">
				<input type="checkbox" name="required" lay-skin="switch" value="1" <#if col.required?? && col.required>checked="checked"</#if> lay-text="启用|禁用">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">数据关联：</label>
			<div class="layui-input-inline">
				<input type="checkbox" name="linkdata" lay-skin="switch" lay-filter="linkdata" value="1" <#if col.linkdata?? && col.linkdata>checked="checked"</#if> lay-text="启用|禁用">
			</div>
			<label class="layui-form-label linkdata" style="<#if col.linkdata?? && col.linkdata == false>display:none;</#if>">关联合并：</label>
			<div class="layui-input-inline linkdata" style="width:90px;<#if col.linkdata?? && col.linkdata == false>display:none;</#if>">
				<select name="linktitlecolspan">
					<option value="0">标题合并列数</option>
					<#list 1..20 as inx>
					<option value="${inx}" <#if col.linktitlecolspan?? && col.linktitlecolspan == inx>selected="selected"</#if>>${inx!''}</option>
					</#list>
				</select>
			</div>
			
			<div class="layui-input-inline linkdata" style="width:90px;<#if col.linkdata?? && col.linkdata == false>display:none;</#if>">			
				<select name="linkmeacolspan">
					<option value="0">指标列数</option>
					<#list 1..20 as inx>
					<option value="${inx}" <#if col.linkmeacolspan?? && col.linkmeacolspan == inx>selected="selected"</#if>>${inx!''}</option>
					</#list>
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">排序方式：</label>
			<div class="layui-input-inline" style="width: 230px;">
				<input type="radio" name="sorttype" value="" title="无" <#if col?? && col.sorttype==''>checked="checked"</#if>>
				<input type="radio" name="sorttype" value="desc" title="降序" <#if col?? && col.sorttype=='desc'>checked="checked"</#if>>
				<input type="radio" name="sorttype" value="asc" title="升序" <#if col?? && col.sorttype=='asc'>checked="checked"</#if>>
			</div>
		</div>
		<div class="layui-form-item">
            <label class="layui-form-label">字符替换：</label>
			<div id="propertypestrrep" style="margin: 0 0 0 100px;">
			<#include "/apps/business/report/design/modeldesign/propertypestrreplist.html">
        	</div>
        	<div class="layui-inline" >
				<div class="layui-input-inline" id="strrepadd" <#if strreplaceList?? && strreplaceList?size gt 0>style="margin: 0 0 0 100px;"</#if>>
					<button class="layui-btn layui-btn-normal"  type="button" ><i class="layui-icon">&#xe608;</i>添加</button>
				</div>
			</div>
        </div>
	  	<div class="layui-form-button" >
			<div class="layui-button-block">
				 <button class="layui-btn layui-btn-normal"   lay-submit>立即提交</button>
			</div>
		</div>
	</form>
</div>

<script>
//Demo
layui.use('form', function(){
  var $ = layui.$
  var form = layui.form;
  form.render(); 
  form.on('select(mea_type)', function(data){
		if(data.value == "summary"){
			$('.mea_sum').show();
		}else{
			$('.mea_sum').hide();
		}
	}); 
	form.on('select(val_filter)', function(data){
			if(data.value == "prop"){
				$('.val_mea').show();
			}else{
				$('.val_mea').hide();
			}
	});
	form.on('switch(linkdata)', function(data){
		if(data.elem.checked){
			  $(".linkdata").show();
		  }else{
			  $(".linkdata").hide();
		  }
	}); 
  $("#strrepadd").click(function(){
	  $("#propertypestrrep").append($("#tpl").text());
	  $("#strrepadd").css("margin","0 0 0 100px");
		form.render();
  });
});
function removeItem(obj){
	$(obj).closest(".propertypestrrep").remove();
	if($.trim($("#propertypestrrep").html()).length==0){
		$("#strrepadd").css("margin","");
	}
}
</script>
<script id="tpl" type="text/html">
<#include "/apps/business/report/design/modeldesign/propertypestrrep.html" />
</script>